import React, { Component ,Fragment} from 'react';
import Header from './common/header/index'
import {Provider} from 'react-redux'
import {BrowserRouter,Route} from 'react-router-dom'
import store from './store/index'
import Home from './pages/home'
import Detail from './pages/detail/loadable'
import Login from './pages/login'
import Write from './pages/write'

class App extends Component {
  render() {
    return (
      <Provider store={store}>
        <Fragment>
            <BrowserRouter>
              <Fragment>
                  <Header />
                  <Route path='/' exact component={Home} />
                  <Route path='/detail/:id' exact component={Detail} />
                  <Route path='/login' component={Login}></Route>
                  <Route path='/write' component={Write}></Route>
              </Fragment>
            </BrowserRouter>
        </Fragment>
      </Provider>
    );
  }
}

export default App;
